/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pradoeditor.comun.ui;

import java.awt.Component;
import java.util.Hashtable;
import javax.swing.Icon;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;

/**
 *
 * @author jaimeg
 */
public class IconNodeRenderer extends DefaultTreeCellRenderer
{
  @Override
  public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
  {
    super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
       
    Icon icon = ((IconNode)value).getIcon();
    
    if (icon != null)
    {
      setIcon(icon);
    }
    return this;
  }
}
